<template>
    <div class="building-container">
      <!-- 表格区域 -->
      <div class="table">
        <el-table :data="list" style="width: 100%">
          <!-- 表示多选 -->
          <!-- <el-table-column width="80" /> -->
          <el-table-column type="index" label="序号" />
          <el-table-column label="病人编号" prop="patientID" />
          <el-table-column label="开始日期" prop="startDate" />
          <el-table-column label="结束日期" prop="endDate" />
          <el-table-column label="诊断疾病名称" prop="diagnosis" />
          <el-table-column label="药品" prop="medicineName" />
          <el-table-column label="药品数量" prop="quantity" />
          <el-table-column label="状态" prop="status" />
        </el-table>
  
      
  
      </div>
  
    </div>
  </template>
  
  <script>
  import { getOrderListAPI } from '@/api/patient'
  export default {
    data() {
      return {
        total: 0,
        list: [],
        params: {
          page: 1,
          pageSize: 10,
        },
      }
    },
    mounted() {
      //页面加载后请求数据
      this.getList()
    },
    methods: {
  
      //显示数据
      getList() {
        getOrderListAPI(this.params).then((res) => {
          console.log("res")
          console.log(res)
          //展示在在页面
          this.list = res.data.rows
          this.total = res.data.total
          this.form.patientName = res.data.rows[0].patientName
        })
      },
      handleSizeChange(pageSize) {
        // 每页条数变化
        this.params.pageSize = pageSize
        this.params.page = 1
        this.getList()
  
      },
      handleCurrentChange(page) {
        // 页码变化
        this.params.page = page
        this.getList()
  
      },
      handleClose() {
        this.flag = false,
          this.form.departmentName = ''
        this.form.bed_number = ''
        this.form.admission_date = this.formattedCurrentTime
        this.getList()
  
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .btn {
    margin: 20px;
  }
  
  .box {
    //浮动
    float: right;
    //flex弹性容器布局
    // display: flex;
    // //默认是从左往右       从右往左
    // justify-content: flex-end;
  
    margin-top: 10px;
    margin-right: 20px;
  }
  
  .department-container {
    padding: 10px;
  }
  
  .search-container {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgb(237, 237, 237, .9);
    ;
    padding-bottom: 20px;
  
    .search-label {
      width: 100px;
    }
  
    .search-main {
      width: 220px;
      margin-right: 30px;
    }
  }
  </style>@/api/doctorWay